<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>企业用户_企业管理_添加企业</title>
		<link rel="stylesheet" type="text/css" href="css/common.css" />
		<link rel="stylesheet" type="text/css" href="css/icon.css" />
		<script src="js/jquery-1.8.2.min.js" /></script>
		<!--<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.css" />-->
		<!--<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.min.css" />-->
		<!--<script src="js/bootstapPage/bootstrap.min.js"></script>-->
		<!--<script src="js/bootstapPage/bootstrap.js"></script>-->
		<style>
			body {
				background: #Fff;
			}
			
			.overlay,
			.overlay select,
			.overlay .form-dropdown {
				width: 110px;
			}
			
			.form>form>div label {
				width: 85px;
				text-align: right;
				display: inline-block;
			}
			
			.form>form>div label.error {
				width: auto;
			}
			
			.form>form>div input {
				height: 30px;
				width: 400px;
			}
		</style>
	</head>

	<body>
		<div class="form" style="padding:30px;">
			<input type="hidden" value="" class="productId" />
			<form class="block-form" id="commentForm">
				<div style="margin-top:0px;">
					<label><span class="red">*</span>企业名称：</label>
					<input type="text" class="bussiness_name" placeholder="请输入企业名称" name="bussiness_name" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red">*</span>企业简称：</label>
					<input type="text" class="bussiness_shorthand" placeholder="请输入企业简称" name="bussiness_shorthand" />
				</div>

				<div style="margin-top:20px;">
					<label><span class="red">*</span>企业类型：</label>
					<div class="overlay" style="width:243px!important;">
						<!--这个是用来存放选中的select的值的-->
						<input type="hidden" value="" class="form-select-value typeValue" />
						<div class="dropdown" style="width:243px!important;">
							<button class="dropdown-toggle form-dropdown" type="button" style="width:243px!important;">
				                    <span class="value text-ellipsis pro_catevalue">请选择</span> 
				                    <span class="caret"></span>
				            </button>
							<ul class="none">
								<li data-value='001'>请选择</li>
								<li data-value='002'>待定</li>
								<li data-value='003'>待定2</li>
								<li data-value='004'>依旧待定</li>
							</ul>
						</div>
					</div>
					<input type="text" value="" class="form-select-value" name="bussiness_type" style="visibility: hidden; width:0px;" />
				</div>

				<div class="select-city" style="margin-top:20px;">
					<label><span class="red">*</span>所属地区：</label>
					<div class="overlay">
						<!--这个是用来存放选中的select的值的-->
						<input type="hidden" value="" class="form-select-value" id="provname" />
						<div class="dropdown">
							<button class="dropdown-toggle form-dropdown" type="button">
				                                <span class="value text-ellipsis pro_provincevalue">选择省份</span>
				                                <span class="caret"></span>
				            </button>
							<ul class="select select_prov none"></ul>
							<select class="prov hidden none" style="margin-top:20px;"></select>
						</div>

					</div>
					<div class="overlay" style="margin-left:18px;">
						<!--这个是用来存放选中的select的值的-->
						<input type="hidden" value="" class="form-select-value" id="cityname" />
						<div class="dropdown">
							<button class="dropdown-toggle form-dropdown" type="button">
				                                <span class="value text-ellipsis pro_cityvalue">选择城市</span>
				                                <span class="caret"></span>
				                           </button>

							<ul class="select  select_city none"></ul>
							<select class="city hidden none " style="margin-top:20px;"></select>
						</div>
					</div>
					<input type="text" class="proarea" name="proarea" id="proarea" style="visibility: hidden; width:0px;" />
				</div>

				<div style="margin-top:25px;">
					<label><span class="red">*</span>联系人：</label>
					<input type="text" class="bussiness_contact" placeholder="请输入联系人" name="bussiness_contact" />
				</div>

				<div style="margin-top:25px;">
					<label><span class="red">*</span>联系电话：</label>
					<input type="tel" class="bussiness_phone" placeholder="请输入联系电话" name="bussiness_phone" />
				</div>

				<div style="margin-top:25px;">
					<label><span class="red hidden">*</span>邮箱地址：</label>
					<input type="email" class="bussiness_email" placeholder="请输入邮箱地址" name="bussiness_email" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red hidden">*</span>公司官网：</label>
					<input type="url" class="bussiness_website" placeholder="请输入公司官网" name="bussiness_website" />
				</div>

				<div style="margin-top:25px;">
					<label><span class="red hidden">*</span>公司简介：</label>
					<textarea placeholder="选填，不超过200字符" style="width:350px;height:100px;vertical-align: top;" class="pro_desc" name="desc"></textarea>
				</div>

				<div style="margin-top:20px;margin-left:150px;">
					<input type="submit" value="保存" class="search-input-button bgblue" id="subButton" />
					<input type="button" value="返回" class="search-input-button " id="backButton" style="margin-left: 80px;" />
				</div>
			</form>
		</div>

		<script src="js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/js.js" type="text/javascript" charset="utf-8"></script>
		<!--<script src="js/wdatePicker/WdatePicker.js" type="text/javascript" charset="utf-8"></script>-->
		<script src="js/jquery.cxselect.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/scroll/jquery.slimscroll.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>
		<script>
			$.validator.setDefaults({
				submitHandler: function() {
					//这里放验证成功之后要执行的函数

				}
			});

			$.validator.addMethod("isareaEmpty", function(value, element) {
				if($('#provname').val() && $('#cityname').val()) {
					return true;
				} else {
					return false;
				}
			}, "<i class=\" icon icon_error_red \" style=\"margin-left:3px\"></i>请选择省市");

			$.validator.addMethod("isTypeEmpty", function(value, element) {
				if($('.typeValue').val()) {
					return true;
				} else {
					return false;
				}
			}, "<i class=\" icon icon_error_red \" style=\"margin-left:135px;\"></i>请选择企业类型");

			$(document).ready(function() {
				$("#commentForm").validate({
					rules: {
						bussiness_name: {
							required: true,
						},
						bussiness_shorthand: {
							required: true,
						},
						bussiness_phone: {
							required: true,
						},
						bussiness_contact: {
							required: true,
						},

						//					修改

						proarea: {
							isareaEmpty: true,
						},
						bussiness_type: {
							isTypeEmpty: true,
						},

					},
					messages: {
						bussiness_name: {
							required: "<i class=\" icon icon_error_red \"></i>请输入企业名称",
						},

						bussiness_shorthand: {
							required: "<i class=\" icon icon_error_red \"></i>请输入企业简称",
						},
						bussiness_phone: {
							required: "<i class=\" icon icon_error_red \"></i>请输入联系电话",
						},
						bussiness_contact: {
							required: "<i class=\" icon icon_error_red \"></i>请输入联系人",
						},

					},

					errorPlacement: function(error, element) {
						error.appendTo('<i class=\" icon icon_error_red \"></i>').appendTo(element.parent());
					},
				});
			});

			$(function() {
				productObj.staticPath = 'js/cityData.min.json'
				productObj.productInit();
				//productObj.getProData();
			});
			//	    $('input[id=backButton]').css('height','40px');
			//	    $('input[id=subButton]').css('padding-bottom','1px');
		</script>

	</body>

</html>